package cn.ainit.sys.pagescript;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.ainit.sys.pages.config.entity.ConfigObject;
import cn.ainit.sys.pagescript.entity.ButtonObject;
import cn.ainit.sys.query.datastore.DataStore;
import cn.ainit.sys.ui.forms.Columns;

@Service
public class PageCommonServiceImpl implements PageCommonService{
	PageCommonDao pageCommonDao;
	
	@Resource
	public void setPageCommonDao(PageCommonDao pageCommonDao) {
		this.pageCommonDao = pageCommonDao;
	}
	
	@Override
	public ButtonObject findButObjectById(String butId) throws Exception {
		return pageCommonDao.findButObjectById(butId);
	}
	
	@Override
	public String executeSql(String sqlTxt, String[] sqlParamStr)
			throws Exception {
		return pageCommonDao.executeSql(sqlTxt, sqlParamStr);
	}
	
	@Override
	public String[] executeProc(String procTxt, String[] procParamStr)
			throws Exception {
		return pageCommonDao.executeProc(procTxt,procParamStr);
	}
	
	@Override
	public ConfigObject findConfigObj(String configId) throws Exception {
		return pageCommonDao.findConfigObj(configId);
	}
	@Override
	public DataStore findDataStoreById(String sdId) throws Exception {
		return pageCommonDao.findDataStoreById(sdId);
	}
	
	@Override
	public List<Columns> findColumnsById(String dsId) throws Exception {
		return pageCommonDao.findColumnsById(dsId);
	}
	
	@Override
	public String getMaxPkStr(String sql) throws Exception {
		return pageCommonDao.getMaxPkStr(sql);
	}
	
	@Override
	public boolean saveObject(String sqlText, String[] valuesArr)
			throws Exception {
		return pageCommonDao.saveObject(sqlText,valuesArr);
	}
	
	@Override
	public boolean updateObject(String sqlText, String[] valuesArr,
			String[] whereValue) throws Exception {
		return pageCommonDao.updateObject(sqlText,valuesArr,whereValue);
	}
}
